#pragma once
#include "Process.h"
#include<thread>
#include<chrono>
#include<qobject.h>

#include <deque>
class Scheduler:public QObject
{
	Q_OBJECT
 
public:
	Scheduler();
	void addProcess(int id, int requiretime);
	void prioRun();
	void roundRun();
signals:
	void processStarted(int id);
	void processUpdated(int id,int remainingtime);
	void processFinished(int id);
private:
	std::priority_queue<Process> readyqueue;
	std::deque<Process> runningqueue;
	std::vector<Process> finishedqueue;
};

